package com.asiainfo.wx.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.session.data.redis.config.ConfigureRedisAction;
import org.springframework.session.data.redis.config.annotation.web.http.EnableRedisHttpSession;
import org.springframework.session.web.http.HeaderHttpSessionIdResolver;

/**
 * Copyright: Copyright (c) 2019  zteits
 *
 * @ClassName: com.asiainfo.wx.config
 * @Description:
 * @version: v1.0.0
 * @author: atao
 * @date: 2019-10-14   10:46
 * Modification History:
 * Date         Author          Version      Description
 * ---------------------------------------------------------*
 * 2019-10-14      atao          v1.0.0          创建
 */
@Configuration
// 单位秒 默认30分钟
@EnableRedisHttpSession(maxInactiveIntervalInSeconds = 30 * 60)
public class SpringSessionConfig {


    @Bean
    public static HeaderHttpSessionIdResolver xAuthToken() {
        return new HeaderHttpSessionIdResolver("X-Auth-Token");
    }


    @Bean
    public static ConfigureRedisAction configureRedisAction() {
        return ConfigureRedisAction.NO_OP;
    }

}
